<!--新增短信模板-->
<template>
  <section class="webview fixHeight">
    <el-scrollbar style="height:100%">
      <el-form ref="form" :model="detail" label-width="100px" class="form">
        <el-form-item label="配置名称">
          <el-input v-model="detail.name" />
        </el-form-item>
        <el-form-item label="配置描述">
          <el-input v-model="detail.remark" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submit">提交</el-button>
          <el-button @click="cancel">返回</el-button>
        </el-form-item>
      </el-form>
    </el-scrollbar>
  </section>
</template>
<script>
import { kitAdd, configUpdate } from '@/api/api'
export default {
  data() {
    return {
      fileList: [],
      typeOptions: [
        {
          value: '1',
          label: '会员套餐'
        },
        {
          value: '2',
          label: '畅聊套餐'
        }],
      detail: {
        'introduce': '',
        'name': '',
        'remarks': '',
        'sort': 0,
        'type': ''
      }
    }
  },
  created() {
    if (this.$route.query.item) {
      this.detail = JSON.parse(this.$route.query.item)
    }
  },
  methods: {
    // 添加/编辑
    submit() {
        configUpdate(this.detail).then(data => {
          Is.tip('编辑成功', 2000, 'success')
          this.$router.back()
        })
       
    },
    // 返回
    cancel() {
      this.$router.back()
    },
  }}
</script>
